package cn.com.cifi.mars.service.impl;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.cifi.mars.entity.DmDimPrice;
import cn.com.cifi.mars.mapper.mars.DmDimPriceMapper;
import cn.com.cifi.mars.service.DmDimPriceService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author plx
 * @since 2019-12-20
 */
@Service
public class DmDimPriceServiceImpl extends ServiceImpl<DmDimPriceMapper, DmDimPrice> implements DmDimPriceService {

    @Override
    public List<DmDimPrice> listByEndTime(LocalDateTime endTime) {
        QueryWrapper<DmDimPrice> priceWrapper = new QueryWrapper<>();
        priceWrapper.eq("version_time", endTime)
                .in("version_type", "dynamic", "structuresaled", "structurestock", "planvalue")
                .eq("org_type", "org_build");
        return list(priceWrapper);
    }
}
